<?php
	// app/Model/User.php
	App::uses('AppModel', 'Model');
	class House extends AppModel {
		var $name = 'House';
		var $primaryKey = 'houseId';
		 public $useTable = 'house';
		//var $belongsTo = 'Styleroom';
		
		 public $belongsTo = array(
	        	'TypeOfSpace' => array(
	            'className' => 'TypeOfSpace',
	            'foreignKey'   => false,
             	'conditions' => array(
                 'House.spaceId = TypeOfSpace.spaceId'
             )),
             'TypeOfPlace' => array(
	            'className' => 'TypeOfPlace',
	            'foreignKey'   => false,
             	'conditions' => array(
                 'House.placeId = TypeOfPlace.placeId'
             ))
             
	    );
		 public $hasMany = array(
	        'HouseImage' => array(
	            'className' => 'HouseImage',
	            'foreignKey' => 'houseId',
	            //'conditions' => array('Comment.status' => '1'),
	            //'order' => 'House_image.id DESC',
	            'limit' => '10',
	            'dependent' => true
	        )
	    );
	}
?>